<html xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui" >  

        <ui:composition template="layout.xhtml">
            <ui:define name="corpo">
    <h:form id="buscar_form" acceptcharset="utf-8"> 
          <div id="breadcrumb">
                        <p:commandLink  actionListener="#{managerIndex.redirect('index.xhtml')}" value="Inicio" update="@form" immediate="true"/> >
                        <p:commandLink  actionListener="#{managerIndex.redirect('config.xhtml')}" value="Configurações" update="@form" immediate="true"/> >
                        <p:commandLink  actionListener="#{managerIndex.redirect('indexOperacao.xhtml')}" value="Operação" update="@form" immediate="true"/>>
                        <p:commandLink  value="Buscar Operação" update="@form" immediate="true"/>
                 </div>
        <p:panel header="Pesquisar Operação">
            <p:messages showDetail="true"  id="msg"/> 

            <h:panelGrid columns="2">
                <h:outputText value="Nome : " />
                <p:inputText  value="#{managerVisaoOperacao.operacao.tipo}" size="30"/>

                <h:outputText value="Descrição : " />
                <p:inputText  value="#{managerVisaoOperacao.operacao.descricao}" size="30"/>
            </h:panelGrid>

            <p:commandButton value="Buscar" icon="view" actionListener="#{managerVisaoOperacao.buscar()}" update="operacaoTable"/>
            <br/>
            <br/>
            <p:dataTable id="operacaoTable" var="operacao" value="#{managerVisaoOperacao.operacoes}" 
                         paginator="true" rows="5"
                         styleClass="table-result-search"
                         paginatorPosition="bottom"
                         paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"  
                         rowsPerPageTemplate="5,10,15">     
                <f:facet name="header">  
                    Dados da operação
                </f:facet>
                <p:column  style="width:200px;">  
                    <f:facet name="header" >   
                        Nome
                    </f:facet>  
                    <h:outputText value="#{operacao.tipo}" />  
                </p:column>                
                <p:column  style="width:400px;">  
                    <f:facet name="header" >   
                        Descrição
                    </f:facet>  
                    <h:outputText value="#{operacao.descricao}" />  
                </p:column>
                <p:column style="width:40px;">  
                    <f:facet name="header">  
                        <h:outputText value="Opções" />   
                    </f:facet>
                    
                    <p:commandButton  icon="editar" actionListener="#{managerEditarOperacao.redirect('editarOperacao.xhtml',operacao)}" update="@form"/> 
                    <p:commandButton  icon="view" actionListener="#{managerVisaoOperacao.redirect('visualizarOperacao.xhtml',operacao)}" update="@form"/>   
 
                </p:column>   

            </p:dataTable>  

            <p:panel styleClass="painel-botoes">
                <p:commandButton icon="ui-icon-arrowreturnthick-1-w" value="Voltar" actionListener="#{managerOperacao.redirect('indexOperacao.xhtml')}" update="@form"/> 
            </p:panel>
        </p:panel>


    </h:form>
            </ui:define>
        </ui:composition>
</html>
